package HomeWork2;

public class Class1 {

	public static int[] toNull(int[] arr,int len){
		for(int i=0;i<len;i++){
		arr[i]=0;
		}
		return arr;
	}
	
	public static void printArr(int[] arr) {
		for (int i = 9; i >= 0; i--) {
			System.out.print(arr[i]);
			}
		System.out.println();
		}	
	
	public static int[] plusOne(int[] arr) {
		int i=0;
		while(arr[i]==9){
			i++;
			}
		arr[i]++;
		toNull(arr,i);
		return arr;
		}		
	
	public static boolean lucky(int[] arr) {
		int i=0,ch=0,nch=0;
		for (i = 0; i < 5; i++) {
			ch+=arr[i*2];
			nch+=arr[i*2+1];
			}
		return ch==nch;
		}
	
	public static void main(String[] args) {
		int n=0;
		int[] arr=new int[11];
		arr=toNull(arr,10);
		while(arr[10]==0){
			plusOne(arr);
			if(lucky(arr)){n++;}
		}
		System.out.println(n);
	}

}
